static-libmy=libmymethod.so
dynamic-libmy=libmymath.a

.PHONY:all
all: $(static-libmy) $(dynamic-libmy)

$(static-libmy):mylog.o print.o
	ar -rc $@ $^

log.o print.o:mylog.c print.c
	gcc -c $^

$(dynamic-libmy):math.o
	gcc -shared -o $@ $^

math.o:math.c
	gcc -fPIC -c math.c

.PHONY:output
output:
	mkdir -p ./libmy/include
	mkdir -p ./libmy/lib
	cp *.h ./libmy/include/
	cp *.so ./libmy/lib/
	cp *.a ./libmy/lib/

.PHONY:clean
clean:
	rm -rf *.a *.so *.o libmy



